package com.sugar.subscribe.course.module.business.dal.mysql.coachvenue;

import java.util.*;

import com.sugar.subscribe.course.framework.common.pojo.PageResult;
import com.sugar.subscribe.course.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.subscribe.course.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.subscribe.course.module.business.dal.dataobject.coachvenue.CoachVenueDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.subscribe.course.module.business.controller.admin.coachvenue.vo.*;

/**
 * 教练授课场地 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface CoachVenueMapper extends BaseMapperX<CoachVenueDO> {

    default PageResult<CoachVenueDO> selectPage(CoachVenuePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CoachVenueDO>()
                .eqIfPresent(CoachVenueDO::getCoachId, reqVO.getCoachId())
                .eqIfPresent(CoachVenueDO::getVenueId, reqVO.getVenueId())
                .likeIfPresent(CoachVenueDO::getVenueName, reqVO.getVenueName())
                .eqIfPresent(CoachVenueDO::getCityId, reqVO.getCityId())
                .likeIfPresent(CoachVenueDO::getCityName, reqVO.getCityName())
                .betweenIfPresent(CoachVenueDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CoachVenueDO::getId));
    }

}